BIN=process
CC=gcc
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
$(BIN):$(OBJ)
	$(CC) -o $@ $^
%.o:%.c
	$(CC) -c $<
.PHONY:clean
clean:
	rm -f $(BIN) $(OBJ)





















#BIN=hello.exe
##SRC=$(shell ls *.c)
#SRC=$(wildcard *.c) # wildcard 函数，获取当前目录下所有的原文件
#OBJ=$(SRC:.c=.o) # 将SRC里面的文件后缀.c换成.o然后给OBJ
#
#$(BIN):$(OBJ)
#	@gcc -o $@ $^
#	@echo "linking $^ to $@ ... done"
#%.o:%.c 
#	@gcc -c $<
#	@echo "compling $< to $@ ... done"
#.PHONY:test
#test:
#	@echo "Debug-------------"
#	@echo $(SRC);
#	@echo "Debug------------"
#	@echo $(BIN);
#	@echo "Debug------------"

#BIN=hello.exe
#SRC=test.c
#$(BIN):$(SRC)
#	@echo "开始执行代码！"
#	@gcc -o $@ $^
#	@echo "执行完成！"
#.PHONY:clean
#clean:
#	@echo "清理工作开始!"
#	@rm -f $(BIN)
#	@echo "清理工作完成!"



#test.exe:test.c
#	gcc test.c -o test.exe
#test.exe:test.c
#	gcc -o test.exe test.c
#.PHONY:pwd
#pwd:
#	shell pwd
#test.exe:test.o
#	gcc test.o -o test.exe
#test.o:test.s
#	gcc -c test.s -o test.o
#test.s:test.i
#	gcc -S test.i -o test.s
#test.i:test.c
#	gcc -E test.c -o test.i
#.PHONY:clean
#clean:
#	rm -f test.exe test.i test.s test.o
#	printf("清理完毕！\n");
